package com.jianbing.north.mapper;

import java.sql.Timestamp;
import java.util.List;

import com.jianbing.common.core.domain.AjaxResult;
import com.jianbing.north.domain.NorthAnswerRecord;
import com.jianbing.north.domain.NorthUserRecordDTO;
import org.apache.ibatis.annotations.Param;

/**
 * 用户测试结果Mapper接口
 * 
 * @author ruoyi
 * @date 2024-06-21
 */
public interface NorthAnswerRecordMapper 
{
    /**
     * 查询用户测试结果
     * 
     * @param id 用户测试结果主键
     * @return 用户测试结果
     */
    public NorthAnswerRecord selectNorthAnswerRecordById(Long id);

    /**
     * 查询用户测试结果列表
     * 
     * @param northAnswerRecord 用户测试结果
     * @return 用户测试结果集合
     */
    public List<NorthAnswerRecord> selectNorthAnswerRecordList(NorthAnswerRecord northAnswerRecord);

    /**
     * 新增用户测试结果
     * 
     * @param northAnswerRecord 用户测试结果
     * @return 结果
     */
    public int insertNorthAnswerRecord(NorthAnswerRecord northAnswerRecord);

    /**
     * 修改用户测试结果
     * 
     * @param northAnswerRecord 用户测试结果
     * @return 结果
     */
    public int updateNorthAnswerRecord(NorthAnswerRecord northAnswerRecord);

    /**
     * 删除用户测试结果
     * 
     * @param id 用户测试结果主键
     * @return 结果
     */
    public int deleteNorthAnswerRecordById(Long id);

    /**
     * 批量删除用户测试结果
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteNorthAnswerRecordByIds(Long[] ids);

    Long selectTodayCountByUserIdAndPartAndDifficult(@Param("userId") Long userId, @Param("part") Long part, @Param("difficulty") Long difficulty);

    List<Timestamp> selectEverydayRightNumByUserIdAndPartAndDifficulty(@Param("userId") Long userId,@Param("part") Long part,@Param("difficulty") Long difficulty);

    List<NorthUserRecordDTO> selectNorthAnswerRecordSummaryList(@Param("userId")Long userId, @Param("part")Long part);

    Long getFraction(@Param("userId")Long userId,@Param("part")Integer part);
}
